package com.youhome.api.dto;

import lombok.Data;

/**
 * Created by chen365 on 2017/10/18.
 */
@Data
public class Result<T> {

    private Integer status; //状态

    private String msg; //提示信息

    private T data; //数据

    public Result() {
    }

    public Result(Integer status, String msg) {
        this.status = status;
        this.msg = msg;
    }

    public Result(Integer status, String msg, T data) {
        this.status = status;
        this.msg = msg;
        this.data = data;
    }

    public Result(ResultCode resultCode, T data) {
        this.status = resultCode.getStatus();
        this.msg = resultCode.getMsg();
        this.data = data;
    }

    public Result(ResultCode resultCode) {
        this.status = resultCode.getStatus();
        this.msg = resultCode.getMsg();
    }
}
